package com.lei.study.cds.unit1;

import java.math.BigDecimal;

/**
 * @author 伍磊
 */
public class Utils {

    public static BigDecimal avg(BigDecimal... values) {
        int length = values.length;
        BigDecimal sum = BigDecimal.ZERO;
        for (BigDecimal value : values) {
            sum = sum.add(value);
        }
        return sum.divide(new BigDecimal(length));
    }
}
